import { queryApplyApiByIdReq, queryCancelApiApproveByIdReq, queryRemoveDataApiByIdReq } from './api'

export default {
  namespace: 'myApply',
  state: {
  },
  effects: {
    * queryRemoveDataApiById({ params, cb }, { call, put }) {
      const res = yield call(queryRemoveDataApiByIdReq, params)
      if (cb) {
        cb(res)
      }
    },
    * queryCancelApiApproveById({ params, cb }, { call, put }) {
      const res = yield call(queryCancelApiApproveByIdReq, params)
      if (cb) {
        cb(res)
      }
    },
    * queryApplyApiById({ params, cb }, { call, put }) {
      const res = yield call(queryApplyApiByIdReq, params)
      if (cb) {
        cb(res)
      }
    },
  },
  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      }
    },
  },
}
